-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not update sidebar for active report drafts #5317
Conversation
5e78c84
to
4547d90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had one little change for the comment. Otherwise the ocde looks great! You have done a great job, thank you. 🎉
We will wait with merging this after the n6 release just to avoid any problems. Tahnk you for understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, meant to request changes.
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
@meetmangukiya Thanks you very much 🙏 Putting this on hold for the time being. |
Hmm. I think there is an issue with this PR. @meetmangukiya
cc: @mountiny. |
@parasharrajat Thank you for having a look into this. I am not sure if I understand the problem here, I think that is the behaviour we want (to be different than in staging), essentially we do not want to make any ui changes to LHN while user is typing (on web or desktop where you can see LHN). Therefore we will add the pencil icon or reshuffle the LHN once user switches reports as I do not need to know I have a draft report in the report I just type. Have you meant some other problem? Sorry if I have misunderstood your comment 😅 |
@mountiny Why? What I understood from the issue description is that we want to block the shuffle until we switch the chat. (but title says different story). So IMO, a solution should
Let me know if this makes sense. |
@parasharrajat I see. I agree it would be good to make the pencil icon disappear when the draft is deleted (or message sent) and not wait for reports switch. But coming from the original problem which @mallenexpensify thought, I think the main idea is to not change anything in UI while person is composing the message. The problem now is that as you pause for a bit when typing, the LHN changes and icon is add and it is very eye-catching and you feel like you got a new message while this change is actually also not so important. Therefore I would say we should not add the pencil icon when we are starting the draft as well, so it is not distracting (it is how it works in Signal for example). We could think of adding functionality to remove the icon when the draft is deleted, but I dont think this is so important now. I believe we could go with this change and over time evaluate if we want to change the behaviour again to improve it. What do you think @mallenexpensify? |
Yes, I am with @mountiny, we did not want any visual feedback if draft comment changed is for current report to avoid it from being a distraction. |
So yeah, if we allow the pencil to be removed when the draft is cleared that should be enough. I would say do the above change in this PR as this is currently working on Staging and with this PR we will overwrite that change and break it. At last, it's your call. Apart from this, I will still do a test to make sure things are working as they should. |
@parasharrajat I get your point here and I am open to making the change here if it would be easy update. @meetmangukiya Would you be able to look into this (ie. when user has draft with icon shown and they delete the message, do NOT change the LHN order but only hide the pencil icon). Otherwise the behaviour should be the same. I would guess it will be minor update, but apologies if I am wrong. Thank you very much for your time. |
I think it wouldn't be a simple implementation. Currently, we are achieving this by using App/src/pages/home/sidebar/SidebarLinks.js Lines 165 to 172 in 4547d90
The pencil is conditional on If we had to do this, I suppose we can do something like:
Although this isn't a particularly good solution. Can think about more if we do decide this is what we want to do. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Now it seems to me that the change I requested is a low priority and After analysis, I can say that it requires a complex solution.
We can skip that for now. I tested other features of the app(IOU, incoming messages, etc) and LHN is reacting to all that so I would say the solution is good.
Thank you @meetmangukiya and @parasharrajat for looking into this. I agree and I would say the best approach now is to just go ahead and we can always create a new issue in future to tweak the behaviour based on how it goes. Once the N6 hold is off, I will merge this! @mallenexpensify thank you for your 2 cents here as well 🙇 |
Hi @meetmangukiya, the As this PR is a bit bigger, I would prefer if we could always merge During the N6 rush, we have merged a lot of small (and some bigger) polish PRs internally and externally, so it is possible there will be some regressions and better to catch it now than in staging. Thank you for understanding! This wont take long hopefully. |
WebScreen.Recording.2021-10-21.at.9.37.03.AM.movDesktopScreen.Recording.2021-10-21.at.9.40.15.AM.mov |
@mountiny any idea why the CI is failing? |
@meetmangukiya Thank you very much for merging that! It must be related to Rory's post here. There is some problem with Gemfile, so we have to wait for that to be fixed. But once the tests pass, I will merge this! Thank you very much for your hard and great work on this one! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meetmangukiya Actually, reading over it, I feel like one little comment about why we do this would be helpful for anyone coming to this later. Feel free to tweak the comment, if you think it can be clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Let's hope the tests will be fixed soon, thank you!
@meetmangukiya Sorry to ask again, but can you please merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @roryabraham in version: 1.1.10-2 🚀
|
Details
Add
shouldComponentUpdate
method to limit re-renders to cases where draft comment changes were made to reports other than the active report.Fixed Issues
$ #5166
Tests
For wide width screens
For small screen widths
QA Steps
For wide width screens
For small screen widths
Tested On
Screenshots
Web
Screen.Recording.2021-09-17.at.12.55.52.PM.mov
Mobile Web
Simulator.Screen.Recording.-.iPhone.12.-.2021-09-17.at.13.14.44.mp4
Desktop
Screen.Recording.2021-09-17.at.12.59.20.PM.mov
iOS
Simulator.Screen.Recording.-.iPhone.12.-.2021-09-17.at.13.08.31.mp4
Android
Need help testing android, don't have a working local environment for android. Thanks!